#include<stdio.h>
#include<string.h>

void str_change(char *str){
	int length = strlen(str);
	int sign = 0;
	for(int i = 0; i <= length; i++){
		if(str[i] == ' ' | str[i] == ',' | str[i] == '.' | str[i] == '?' | str[i] == '!'){
			for(int j = sign; j < i; j++)
				printf("%c", str[j]);
			if(sign != i)
				printf("\n");
			sign = i+1;	
		}
	}
}

int main(){
	char *s = "  I like ,,,..   C++ programming!";
	str_change(s);
	return 0;
}
